Skip to content

Conversation

@jackzhxng
Copy link
Contributor

Summary

Doing this now just in case later on there appears another module in TorchTune that:

  • Uses "cache_pos" as a buffer name
  • Appears frequently
  • Doesn't require initial state

In this situation we prevent the pte size from blowing up. kv_cache_pos is specific enough that it probably will never appear as the name for another buffer.

Test plan

  • Existing unit tests for kv_cache and attention
  • E2E
    • python -m examples.models.llama.export_llama --model llama3_2_vision --checkpoint /tmp/Llama-3.2-11B-Vision-Instruct/original/consolidated.pth --params examples/models/llama3_2_vision/text_decoder/params/demo_config.json --metadata '{"append_eos_to_prompt": 0, "get_bos_id":128000, "get_eos_ids":[128009, 128001], "get_n_bos": 0, "get_n_eos": 0}' --output_name="llama3_2_vision.pte" -d fp32 --verbose --max_seq_length 64 -kv
    • python -m examples.models.llama3_2_vision.runner.native --model llama3_2_vision --pte llama3_2_vision.pte --tokenizer /tmp/Llama-3.2-11B-Vision-Instruct/original/tokenizer.model --prompt "Who is the founder of Meta?" --params examples/models/llama3_2_vision/text_decoder/params/demo_config.json --max_len 64 --temperature 0 -kv

Note: I'll make a ci test soon 😅

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 13, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7635

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 1 Pending

As of commit f369ada with merge base 2a4256b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 13, 2025
@jackzhxng jackzhxng requested a review from tarun292 January 13, 2025 22:28
@jackzhxng jackzhxng merged commit f31e466 into main Jan 13, 2025
44 of 46 checks passed
@jackzhxng jackzhxng deleted the jz/just-in-case branch January 13, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants